package com.zzptc.lzh.myapp22;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends AppCompatActivity {
    ListView lv;
    String[] s={"第一行","第二行","第三行"};
    //String s;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        lv=findViewById(R.id.lv);
        /*for (int i=0;i<10;i++){
             s=new String("第"+i+"行");
        }*/
        ArrayAdapter<String> adapter = new ArrayAdapter<>(MainActivity.this, R.layout.item,s);
        lv.setAdapter(adapter);
    }
}
